/**
 * Copyright (C)  2011  chen wei hua.
 * Permission is granted to copy, distribute and/or modify this document
 * under the terms of the GNU Free Documentation License, Version 2.0
 * or any later version published by the Free Software Foundation;
 * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 * A copy of the license is included in the section entitled "GNU Free Documentation License".
 */
package com.javaeye.order.web;

import com.javaeye.common.web.BaseReportAction;
import com.javaeye.order.service.ICustomerService;

public class NewCustomerReport extends BaseReportAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1998966732318406119L;

	private ICustomerService service;
	
	public NewCustomerReport() {
		setQueryDateType(1);//三个月
	}
	
	public void setService(ICustomerService service) {
		this.service = service;
	}
	
	public String queryNewCustomer() throws Exception {
		int month = 1;
		int queryDateType = getQueryDateType();
		switch(queryDateType) {
		case 1 :
			month = 3;
			break;
		case 2 :
			month = 6;
			break;
		case 3 :
			month = 12;
			break;
		default :
			break;
		}
		setReportDatas(service.getNewCustomerAtMonth(month));
		return SUCCESS;
	}
}
